-- GENERATED SPELL FOR [King Magni Bronzebeard] --


function spell0_2784(pUnit, Event) --@Avatar,Self--
pUnit:FullCastSpellOnTarget(19135,pUnit)
pUnit:RegisterEvent('Sorts_2784', 15274, 1)
end

function spell1_2784(pUnit, Event) --@Knock Away,n/a--
pUnit:FullCastSpellOnTarget(20686,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2784', 515, 1)
end

function spell2_2784(pUnit, Event) --@Storm Bolt,n/a--
pUnit:FullCastSpellOnTarget(20685,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2784', 9000, 1)
end

function Sorts_2784(pUnit, Event)
local choix_sorts_2784 = math.random(0, 2)
if choix_sorts_2784 == 0 then
pUnit:RegisterEvent('spell0_2784', 1, 1)
end
if choix_sorts_2784 == 1 then
pUnit:RegisterEvent('spell1_2784', 1, 1)
end
if choix_sorts_2784 == 2 then
pUnit:RegisterEvent('spell2_2784', 1, 1)
end
end

function mob2784_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2784', math.random(1500, 3000), 1)
end

function mob2784_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2784_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2784_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2784, 1, 'mob2784_Action')
RegisterUnitEvent(2784, 2, 'mob2784_Leave')
RegisterUnitEvent(2784, 3, 'mob2784_Kill')
RegisterUnitEvent(2784, 4, 'mob2784_Die')
